<%= form_for [:admins, @new_medium], :html => { :class => "form-horizontal new_medium", :multipart => true } do |f| %>

    <% if @new_medium.errors.any? %>
    <div id="error_expl" class="panel panel-danger">
      <div class="panel-heading">
        <h3 class="panel-title"><%= pluralize(@new_medium.errors.count, "error") %> prohibited this new_medium from being saved:</h3>
      </div>
      <div class="panel-body">
        <ul>
        <% @new_medium.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
        </ul>
      </div>
    </div>
  <% end %>

  <div class="control-group">
    <label class="control-label" for="new_medium_name">名称</label>
    <div class="controls">
      <%= f.text_field :name, :class => 'form-control' %>
    </div>
    <%= error_span(@new_medium[:name]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="new_medium_name">链接地址</label>
    <div class="controls">
      <%= f.text_field :link_url, :class => 'form-control' %>
    </div>
    <%= error_span(@new_medium[:link_url]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="new_medium_name">默认图标</label>
    <div class="controls">
      <%= f.file_field :mouse_on_image %>
      <%= f.hidden_field :mouse_on_image_cache %>
    </div>
    <%= error_span(@new_medium[:mouse_on_image]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="new_medium_name">高亮图标</label>
    <div class="controls">
      <%= f.file_field :mouse_off_image %>
      <%= f.hidden_field :mouse_off_image_cache %>
    </div>
    <%= error_span(@new_medium[:mouse_off_image]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="new_medium_name">位置</label>
    <div class="controls">
      <%= f.select(:postion_num, [ nil,1, 2, 3, 4, 5, 6]) %>
    </div>
    <%= error_span(@new_medium[:postion_num]) %>
  </div>

  <br>
  
  <input class="btn btn-primary" name="commit" type="submit" value="新增">
  <a class="btn btn-default" href="/admins/new_media"><span class="translation_missing" title="translation missing: zh-CN.helpers.links.cancel">取消</span></a>

  <br><br>

<% end %>
